/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.tb_car_class.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.service.TreeService;
import com.thinkgem.jeesite.common.utils.StringUtils;
import com.thinkgem.jeesite.modules.tb_car_class.entity.TbCarClass;
import com.thinkgem.jeesite.modules.tb_car_class.dao.TbCarClassDao;

/**
 * 车辆类型管理Service
 * @author ZhangYangZe
 * @version 2017-05-10
 */
@Service
@Transactional(readOnly = true)
public class TbCarClassService extends TreeService<TbCarClassDao, TbCarClass> {

	public TbCarClass get(String id) {
		return super.get(id);
	}
	
	public List<TbCarClass> findList(TbCarClass tbCarClass) {
		if (StringUtils.isNotBlank(tbCarClass.getParentIds())){
			tbCarClass.setParentIds(","+tbCarClass.getParentIds()+",");
		}
		return super.findList(tbCarClass);
	}
	
	@Transactional(readOnly = false)
	public void save(TbCarClass tbCarClass) {
		super.save(tbCarClass);
	}
	
	@Transactional(readOnly = false)
	public void delete(TbCarClass tbCarClass) {
		super.delete(tbCarClass);
	}
}